<?php
class BaseAction extends Action {
	//权限判读
	public function _initialize(){
		if(Session::get('islogin') != TRUE){
			$this->redirect('index/index','',1,'You haven\'t login! Jumping.....');
		}else{
			//continue;
                        $this->assign('menu',  $this->getMenu());
		}
	}
        
        private function getMenu() {
            
            $menu = array();
            $menu = array(
                '管理面板'=>array(
                    'url'=>U('space/index'),
                    'submenu'=>array(),
                    'route'=>'Space/index',
                ),
                '文章管理'=>array(
                    'url'=>U('content/index'),
                    'submenu'=>array(
                        '查看文章'=>array(
                            'url'=>U('content/index'),
                            'route'=>'Content/index',
                        ),
                        '添加文章'=>array(
                            'url'=>U('content/newcontent'),
                            'route'=>'Content/newcontent',
                        ),
                    ),
                    'route'=>'Content/index',
                ),
                '栏目管理'=>array(
                    'url'=>U('category/index'),
                    'submenu'=>array(
                        '查看栏目'=>array(
                            'url'=>U('category/index'),
                            'route'=>'Category/index',
                        ),
                        '添加栏目'=>array(
                            'url'=>U('category/newcategory'),
                            'route'=>'Category/newcategory',
                        ),
                    ),
                    'route'=>'Category/index',
                ),
                '频道管理'=>array(
                    'url'=>U('channel/index'),
                    'submenu'=>array(
                        '查看频道'=>array(
                            'url'=>U('channel/index'),
                            'route'=>'Channel/index',
                        ),
                        '添加频道'=>array(
                            'url'=>U('channel/newchannel'),
                            'route'=>'Channel/newchannel',
                        ),
                    ),
                    'route'=>'Channel/index',
                ),
                '静态页面'=>array(
                    'url'=>U('page/index'),
                    'submenu'=>array(
                        '查看页面'=>array(
                            'url'=>U('page/index'),
                            'route'=>'Page/index',
                        ),
                        '添加页面'=>array(
                            'url'=>U('page/addhtml'),
                            'route'=>'Page/addhtml',
                        ),
                    ),
                    'route'=>'Page/index',
                ),
                '首页大图'=>array(
                    'url'=>U('playbill/index'),
                    'submenu'=>array(),
                    'route'=>'Playbill/index',
                ),
                '用户管理'=>array(
                    'url'=>U('user/index'),
                    'submenu'=>array(),
                    'route'=>'User/index',
                ),
                '友情链接'=>array(
                    'url'=>U('link/index'),
                    'submenu'=>array(),
                    'route'=>'Link/index',
                ),
            );
            return $menu;
        }
}
?>
